import 'package:animated_text_kit/animated_text_kit.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:psi/widgets/gesture.dart';
import 'package:psi/widgets/text_widget.dart';


import 'splash_logic.dart';

class SplashPage extends StatelessWidget {
  final logic = Get.find<SplashLogic>();
  final state = Get.find<SplashLogic>().state;

  @override
  Widget build(BuildContext context) {
    return ClickWidget(
      onTap: logic.goToNext,
      child: Container(
        color: const Color(0xFF7A8CF3),
        alignment: Alignment.center,
        child: AnimatedTextKit(
          animatedTexts: [
            ColorizeAnimatedText(
              'PSI',
              textStyle: TextWidget.createTextStyle(
                fontSize: 32.sp,
                fontWeight: FontWeight.bold,
              ),
              speed: Duration(milliseconds: 500),
              colors: [
                Color(0xF2BB05F5),
                Color(0xBD3DF10D),
                Color(0xBD0B7DEE),
                Color(0xBDEF9C14)
              ],
            ),
          ],
          isRepeatingAnimation: false,
          totalRepeatCount: 4,
          displayFullTextOnTap: true,
          stopPauseOnTap: true,
          onFinished: () {
            logic.goToNext();
          },
        ),
      ),
    );
  }
}
